<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="../include/taglib.jsp"%>
<%
    response.setHeader("Cache-Control", "no-store");
			response.setHeader("Pragrma", "no-cache");
			response.setDateHeader("Expires", 0);
			String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>应用系统事件报表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta name="Keywords" content=" " />
<meta name="Description" content=" " />
<%@ include file="../include/common.jsp"%>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/jsp/report/jquery.table.merge-1.0.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/calendar/zh_CN_WdatePicker.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/select/jquery.multiselect.min.js"></script>
	
	
<link type="text/css" rel="stylesheet" href="merge.css" />

<script type="text/javascript">
	$().ready(function() {$('#process').mergeCell({
		url : '${pageContext.request.contextPath}/report/event-report!eventReport.action',
		cols : 7,
		head_rows : 1,
		head_cols : 1,
		//colthreds:[7],
		evenodd : true
		//pmerges : [[18, 20, 2, 3], [7, 15, 6, 9]]
		});
	});
	//改变统计类型
	function changetime(){
		var timeSection = $('#fixtime').attr('value');
		if(timeSection == 0){
			$('#weekScope').css('display','none');
			$('#dayScope').css('display','none');
			$('#monthScope').css('display','none');
			$('#yearScope').css('display','none');
			initDate();
		}else if(timeSection == 1){
			$('#dayScope').css('display','');
			$('#weekScope').css('display','none');
			$('#monthScope').css('display','none');
			$('#yearScope').css('display','none');
			initDate();
		}else if(timeSection == 2 || timeSection == 5){
			$('#weekScope').css('display','');
			$('#dayScope').css('display','none');
			$('#monthScope').css('display','none');
			$('#yearScope').css('display','none');
			initDate();
		}else if(timeSection == 3){
			$('#weekScope').css('display','none');
			$('#dayScope').css('display','none');
			$('#monthScope').css('display','');
			$('#yearScope').css('display','none');
			initDate();
		}else if(timeSection == 4){
			$('#weekScope').css('display','none');
			$('#dayScope').css('display','none');
			$('#monthScope').css('display','none');
			$('#yearScope').css('display','');
			initDate();
		}
	}
	function add_zero(temp)
	{
		 if(temp<10) 
		 		return "0"+temp;
		 else 
		 		return temp;
	}
	//赋默认值
	function initDate(){
		var currentDate =new Date();
		if($('#fixtime').val()== 1){
			$('#beginDay').val(currentDate.getFullYear()+"-"+add_zero(currentDate.getMonth()+1)+"-"+add_zero(currentDate.getDate()));
		}else if($('#fixtime').val()== 2 || $('#fixtime').val()== 5 ){
			$('#beginWeek').val(currentDate.getFullYear()+"-"+add_zero(currentDate.getMonth()+1)+"-"+add_zero(currentDate.getDate()));
 			$('#endWeek').val(currentDate.getFullYear()+"-"+add_zero(currentDate.getMonth()+1)+"-"+add_zero(currentDate.getDate()));
		}else if($('#fixtime').val()== 3 ){
			$('#beginMonth').val(currentDate.getFullYear()+"年"+add_zero(currentDate.getMonth()+1)+"月");
 			//$('#endMonth').val(currentDate.getFullYear()+"年"+add_zero(currentDate.getMonth()+1));
		}else if($('#fixtime').val()== 4 ){
			$('#beginYear').val(currentDate.getFullYear()+"年");
		}
	}
</script>
</head>
<body>
<div class="searchFormStyle" style="height:35px;">
	<div style="width:100%;">
		<div style="float:left;width:auto;">
			<span><label>统计类型：</label></span>
			<span style="padding-left:0px;">
				<select id="fixtime" name="fixtime" class="select" style="width:90px;  text-align:center;" onchange="changetime();">
					<option value="0">全部</option>
					<option value="1" >日报</option>
					<option value="2" >周报</option>
		    		<option value="3" >月报</option>
		    		<option value="4" >年报</option>
		    		<option value="5" >自定义</option>
		    	</select>
			</span>
		</div>
		<div style="float:left;width:auto;margin-left:10px;display:none" id="dayScope">
			<span><label>统计时间：</label></span>
			<span id="dayData">
				<input id="beginDay" name="beginDay" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',readOnly:true})"/>
			</span>
		</div>
		<div style="float:left;width:auto;margin-left:10px;display:none" id="weekScope">
			<span><label>统计时间：</label></span>
			<span id="houseData">
				<input id="beginWeek" name="beginWeek" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',readOnly:true})"/>
				<label>-</label>
				<input id="endWeek" name="endWeek" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'%y-%M-%d',minDate:$('#beginDate').val(),readOnly:true})"/>
			</span>
		</div>
		<div style="float:left;width:auto;margin-left:10px;display:none" id="monthScope">
			<span><label>统计时间：</label></span>
			<span id="houseData">
				<input id="beginMonth" name="beginMonth" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy年MM月',maxDate:'%y-%M',readOnly:true})"/>
			<!--  	
				<label>-</label>
				<input id="endMonth" name="endMonth" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy-MM',maxDate:'%y-%M',minDate:$('#beginDate').val(),readOnly:true})"/>
			-->
			</span>
		</div>
		<div style="float:left;width:auto;margin-left:10px;display:none" id="yearScope">
			<span><label>统计时间：</label></span>
			<span id="houseData">
				<input id="beginYear" name="beginMonth" class="Wdate" type="text" onclick="WdatePicker({dateFmt:'yyyy年',maxDate:'%y',readOnly:true})"/>
			</span>
		</div>
		<div style="float:left;width:auto;">
			<span>
		    	<button type="button" id="saveBt" value="查询" class="btn-4" onclick="query();">查询</button>
		    </span>
		</div>
	</div>
</div>
	<div style="width:98%;text-align:center;">
		<h1>应用系统事件报表</h1>
	</div>
	<table id="process" class="report_table" width="98%" cellpadding="0"
		cellspacing="0">
		<tbody>
			<tr>
				<td>应用系统</td>
				<td>产生数</td>
				<td>关闭数</td>
				<td>关闭率</td>
				<td>MTBF</td>
				<td>MTTR</td>
				<td>MTTF</td>
			</tr>
		</tbody>
	</table>
</body>
</html>